@import '../_config.scss';

.products-index {
  // 设置统一的颜色跟去除下划线
  a {
    &,
    &:active,
    &:focus,
    &:hover {
      text-decoration: none;
      color: $color-normal;
    }
  }
  .top-panel {
    background-color: $color-default;
    // 去除ul的默认样式
    ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-flow: row wrap;

      li {
        padding: 10px 0;

        a {
          padding: 10px 25px;
        }
        cursor: pointer;
      }
    }
    // 三个选择框的基础配置
    .category_kids_list,
    .category_list,
    .company_list {
      font-size: 14px;

      .col-xs-1 {
        padding-top: 20px;
        padding-bottom: 20px;
      }

      .col-xs-11 {
        padding-top: 10px;
        padding-bottom: 10px;
      }
    }
    // 分类的配置
    .category_list {
      background-color: $color-new-bg;

      li.active,
      li:hover {
        a {
          color: $color-title;
          font-weight: bold;
        }
      }
    }
    // 子类的配置
    .category_kids_list,
    .company_list {
      li {
        position: relative;
        margin: 5px 10px;
        padding: 0;

        a {
          padding: 5px 15px;
          display: block;
        }

        i {
          display: none;
        }

        &.active,
        &:hover {
          border-radius: 0;
          box-shadow: inset 0 0 0 1px $color-private;

          i {
            display: inherit;
          }

          a {
            color: $color-private;
          }

          .triangle {
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 0 0 20px 20px;
            border-color: transparent transparent $color-private transparent;
            position: absolute;
            right: 0;
            bottom: 0;
          }

          .fa-icon {
            font-size: 10px;
            position: absolute;
            right: 0.5px;
            bottom: 0.5px;
            color: $color-default;
          }
        }
      }
    }

    .company_list {
      border-top: 1px solid $color-border;
    }
  }

  .list-panel {
    margin-top: 20px;
    background-color: $color-default;

    .sort-head {
      background-color: $color-new-bg;
      // padding-top: 15px;
      // padding-bottom: 15px;
      >div:first-child{
        padding-top: 15px;
        padding-bottom: 15px;
      }

      .pull-right{
        padding-top: 15px;
        padding-bottom: 15px;
      }

      font-size: 14px;
      ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-flow: row wrap;

        li{
          padding-top: 15px;
          padding-bottom: 15px;
          margin-right: 20px;
          &:last-child{
            margin-right: 0;
          }

          &.active, &:hover{
            box-shadow: inset 0 -3px $color-private;
            a{
              color: $color-private;
            }
          }
        }
      }
    }

    .list {
      padding: 15px;
      .col-all-1-5-per {
        padding-top: 15px;
        width: 20% !important;

        img {
          width: 100%;
          min-height: 200px;
        }

        .old-price{
          margin-top: 2px;
          text-decoration: line-through;
        }

        .cut-title{
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: block-axis;
          height: 40px;
          line-height: 20px;
        }

        &:hover {
          box-shadow: 0 0 5px 1px $color-bg;
        }
      }
    }

    .panel-footer{
      background-color: $color-default;
      border: 0;
    }
  }
}

.products-index-mobile{
  .sort-ul{
    list-style-type: none;
    margin: 0;
    padding: 0;
    background-color: #f6f7fc;

    display: flex;
    flex-flow: row nowrap;

    >li{
      width: 25%;
      text-align: center;
      padding: 15px 0;
      padding: 4vw 0;

      a{
        font-size: 13px;
        font-size: 3.5vw;
        color: #999999;
      }

      &:not(:last-child).active{
        a{
          color: #222222;
        }
      }

      &:last-child{
        a{
          color: #222222;
        }
      }
    }
  }

  .product-list{
    margin: 5px 10px;
    margin: 1.33vw 2.66vw;
    display: flex;
    flex-flow: row wrap;

    .list-item{
      display: block;
      width: 50%;

      padding: 5px;
      padding: 1.33vw;

      img{
        width: 100%;
        height: 130px;
        height: 35vw;
        margin-bottom: 5px;
        margin-bottom: 1.33vw;
      }

      .price{
        margin: 0;
        margin-bottom: 10px;
        margin-bottom: 2.66vw;
        font-size: 14px;
        font-size: 3.73vw;
        .text-mid-line{
          font-size: 11px;
          font-size: 2.93vw;
        }
      }

      .title{
        margin: 0;
        font-size: 12px;
        font-size: 3.2vw;
        line-height: 15px;
        line-height: 4vw;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        min-height: 28px;
        min-height: 7.5vw;
      }
    }
  }

  .shuaixuan-panel{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.40);

    .main-panel{
      position: absolute;
      top: 0;
      right: 0;
      width: 80%;
      height: 100%;
      background-color: #fff;
      padding: 15px;
      padding: 4vw;

      ul{
        list-style-type: none;
        margin: 0;
        padding: 0;

        display: flex;
        flex-flow: row wrap;

        li{
          color: #222222;
          background-color: #f6f7fc;
          border-radius: 5px;
          border-radius: 1.33vw;
          padding: 5px 15px;
          padding: 1.33vw 4vw;
          margin: 10px 10px 10px 0;
          margin: 2.66vw 2.66vw 2.66vw 0;

          &.active{
            a{
              color: #fff;
            }
            background-color: #64c879;
          }
        }
      }

      h1{
        text-align: left;
        margin: 0;
        margin-top: 15px;
        margin-top: 4vw;
        padding-bottom: 10px;
        padding-bottom: 2.66vw;
        font-size: 13px;
        font-size: 3.5vw;
        color: #999999;
        border-bottom: 1px solid #e5e5e5;
      }
    }
  }
}
